package com.yiboshi.rehrs.helper.core;

import com.yiboshi.rehrs.common.ZhongConfig;
import com.yiboshi.rehrs.helper.ProxyHelper;
import com.yiboshi.rehrs.helper.ZhongConfigHelper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@Data
public class HeaderHelperDaxiang implements HeaderHelper{


    @Autowired
    ZhongConfigHelper configHelper;

    @Autowired
    ProxyHelper proxyHelper;
    @Override
    public Map<String, String> incept(String type, int count) throws Exception {
        //VIP账号登录大象获取token，多个token和域名需要对应


        return null;
    }


    //定时任务 获取token 检查token有效性
    public void getAndCheckToken() throws Exception {
        ZhongConfig zhongConfig = getZhongConfig();
        String vipAccount = zhongConfig.getParamMap().get("vipAccount");
        List<String> domains = zhongConfig.getDomains();

        for (String domain : domains) {
            //if(domain.start)

        }

    }

    private ZhongConfig getZhongConfig() {
        ZhongConfig config = configHelper.getConfig(2);
        return config;
    }
}
